<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'news.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">

<script type="text/javascript">
function validate(){
var s=document.getElementById("newsTitle").value;
var b=document.getElementById("newsContent").value;
     if(s==null||s=="")
	{
	    
		alert("请您填写标题");
		return false;
	}
	else if(b==null||b=="")
	{
		alert("请您填写内容");
		return false;
	}
	else if(b.length>2800)
	{
	alert("您所填写的字数为"+b.length+"（含格式符号），"+"\n\n"+"且已超出可存储范围，请缩减字数");
	return false;
	}
	else if(confirm("请您仔细核对新闻,"+"\n"+"您确定要发布吗？"))
		{ 
			 return true;
		 }
	 else
		{
			  return false;
		 }

}

</script>
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

	</head>

	<body>
		<div align="center">
			最新公告
		</div>
		<form name="form1" method="post" action="zcg/addNews.action" onsubmit="return validate();">
			<s:textfield name="newsTitle" id="newsTitle" theme="simple" size="100">标题:</s:textfield>
			<input type="hidden" name="newsContent" align="middle" id="newsContent"
				>
			<iframe style="overflow-x:hidden" src="163Editor/editor/editor.html?id=newsContent" frameborder="0"
				scrolling="no" width="700" height="320"></iframe>
			<table>
				<tr>
					<td>
						<s:submit name="submit" id="submit" value="确定" align="center" 
													theme="simple"></s:submit>
					</td>
					<td>
						<s:reset name="cancel" id="cancel" value="取消" align="center"
							theme="simple"></s:reset>
					</td>
				</tr>
				
			</table>
			<div style="font-size:14px;color:red;">注意：正文部分最多可容纳4000字节数据，即2000字左右,若出现异常，请缩减字数</div>
		</form>
	</body>
</html>
